package by.bsu.touragency.db.beans;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Eat {
	private int id;
	private String type;
	private String about;

	public Eat() {
		super();
	}

	public String getAbout() {
		return about;
	}

	public void setAbout(String about) {
		this.about = about;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public boolean isValidMealType(String mealtype) {
		if (mealtype != "" & mealtype != null && mealtype.length() < 3) {
			Pattern p = Pattern.compile("([A-Z])*([a-z])*");
			Matcher m = p.matcher(mealtype);
			setType(mealtype);
			return m.matches();
		} else
			return false;
	}

}
